package com.luis.toolbox.handler.rc;

import com.luis.toolbox.intf.PrepareHandler;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.messaging.MessageHeaders;
import org.springframework.stereotype.Component;

import com.luis.toolbox.common.Constants;

@Component
@ConditionalOnProperty(prefix="outbound",name = "destination", havingValue = "rc")
public class RootCloudPrepareHandler implements PrepareHandler {

	@Value("${companyCode:'POC'}")
	private String companyCode;
	/**处理采集项和分析项的结构差异，去除采集项前面的公司简称*/

	@Override
	public Object handle(String payload, MessageHeaders headers) {
		//分割数据的时候需要考虑不同系统的报文结构，兼容unix和windows
		return Constants.handleCompanyCode(payload,companyCode);
	}

}
